package ltd.smallwang;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

class Leetcode0138Test {

  private final Leetcode0138 leetcode0138 = new Leetcode0138();

  @Test
  void canCompleteCircuit01() {
    Assertions.assertThat(leetcode0138.canCompleteCircuit(new int[] { 1, 2, 3, 4, 5 }, new int[] { 3, 4, 5, 1, 2 }))
        .isEqualTo(3);
  }

  @Test
  void canCompleteCircuit02() {
    Assertions.assertThat(leetcode0138.canCompleteCircuit(new int[] { 1, 2, 3, 4, 4 }, new int[] { 3, 4, 5, 1, 2 }))
        .isEqualTo(-1);
  }

  @Test
  void canCompleteCircuit03() {
    Assertions.assertThat(leetcode0138.canCompleteCircuit(new int[] { 2, 3, 4 }, new int[] { 3, 4, 3 }))
        .isEqualTo(-1);
  }

}
